﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Joyintech.Common;

namespace Joyintech.BLL.inpiao365
{
    public partial class systemArea_BLL
    {
        /// <summary>
        /// 得到一个对象实体，从缓存中。
        /// </summary>
        public Joyintech.Model.inpiao365.systemArea GetModelByCache(int areacode)
        {

            string CacheKey = "systemAreaModel-" + areacode;
            object objModel = DataCache.GetCache(CacheKey);
            if (objModel == null)
            {
                try
                {
                    objModel = dal.GetModelByCode(areacode);
                    if (objModel != null)
                    {
                        int ModelCache = ConfigHelper.GetConfigInt("ModelCache");
                        DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
                    }
                }
                catch { }
            }
            return (Joyintech.Model.inpiao365.systemArea)objModel;
        }
    }
}
